<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
</head>
<body>
    <h3>量词语法</h3>

    <script>
        // 字符出现的次数
        // a字符出现3次以上
        var regE01 = /a{3}/
        // console.log(regE01.test("a"));// false
        // console.log(regE01.test("aa"));// false
        // console.log(regE01.test("aaa"));// true
        // console.log(regE01.test("aaa"));// true

        // a字符出现3-6次
        var regE02 = /^a{3,6}$/
        console.log(regE02.test("a"));// false
        console.log(regE02.test("aa"));// false
        console.log(regE02.test("aaa"));// true
        console.log(regE02.test("aaaa"));// true
        console.log(regE02.test("aaaaa"));// true
        console.log(regE02.test("aaaaaa"));// true
        console.log(regE02.test("aaaaaaa"));//false

    </script>
</body>
</html>